package com.ktjy.ktmall.service.impl.dto;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ktjy.ktmall.domain.dto.AttrWithValues;
import com.ktjy.ktmall.mapper.vo.AttrWithMapper;
import com.ktjy.ktmall.service.dto.AttrWithService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AttrWithServiceimpl extends ServiceImpl<AttrWithMapper, AttrWithValues> implements AttrWithService {
    @Autowired
    private AttrWithMapper attrWithMapper;

    //1.查询商品编号未关联的属性
    @Override
    public List<AttrWithValues> selectUnassociatedAttrsAndValues(Long goodsId) {
        return attrWithMapper.selectUnassociatedAttrsAndValues(goodsId);
    }

    //2.查询规格关联的属性值
    @Override
    public List<AttrWithValues> selectAttrValuesList(Long attrId, Long goodsId) {
        return attrWithMapper.selectAttrValuesList(attrId,goodsId);
    }

    //3.查询sku未关联的属性
    @Override
    public List<AttrWithValues> selectSkuValueVoListBySkuList(String stockSku) {
        return attrWithMapper.selectSkuValueVoListBySkuList(stockSku);
    }

    //4.查询sku关联的属性值
    @Override
    public List<AttrWithValues> selectSkuValueVoListBySkuIdAndAttrId(Long attrId, String stockSku) {
        return attrWithMapper.selectSkuValueVoListBySkuIdAndAttrId(attrId,stockSku);
    }
}
